package com.feicheng.service.impl;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.feicheng.entity.Warehouse;
import com.feicheng.mapper.WarehouseMapper;
import com.feicheng.model.UserAndWarehouse;
import com.feicheng.service.IWarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhennan.liu
 * @since 2022-07-04
 */
@Service
public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse> implements IWarehouseService {

    //依赖注入
    @Autowired
    private WarehouseMapper warehouseMapper;

    /**
     * 通过仓库管理员id查询仓库id
     * @author zhennan.liu
     * @param userId
     * @return
     */
    @Override
    public Integer selectByid(Integer userId) {
        Integer integer = warehouseMapper.selectByid(userId);
        return integer;
    }


    /**
     * 通过查询条件查询仓库列表，分页
     * @author lu.yu
     * @param pageInfo
     * @param wrapper
     * @return
     */
    @Override
    public Page<UserAndWarehouse> getByPage(Page<UserAndWarehouse> pageInfo, Wrapper wrapper) {
        return warehouseMapper.selectByPage(pageInfo,wrapper);
    }


}
